package com.haolijun.eecms.controller;

import com.haolijun.eecms.common.R;
import com.haolijun.eecms.service.RoleService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

/**
 * @ClassName RoleController
 * @Description TODO
 * @Author hljstart
 * @Date 2023/3/11 11:40
 * @Version 1.0
 */
@RestController
@RequestMapping("/role")
@Tag(name = "RoleController",description = "角色Web接口")
public class RoleController {

    @Autowired
    private RoleService roleService;


    @GetMapping("/searchAllRole")
    @Operation(summary = "查询全部角色")
    public R searchAllRole(){
        List<HashMap> roles = roleService.searchAllRole();
        return R.ok().data("roles",roles);
    }
}
